//
//  UserInfoBean.m
//  Traffic
//
//  Created by CruItaly on 2017/11/1.
//  Copyright © 2017年 com.infohold.cn. All rights reserved.
//

#import "UserInfoBean.h"

@implementation UserInfoBean

-(void) encodeWithCoder:(NSCoder *)aCoder{
    //在编码方法中，需要对对象的每一个属性进行编码。
    [aCoder encodeObject:_name forKey:@"name"];
    [aCoder encodeObject:_password forKey:@"password"];
    [aCoder encodeObject:_phoneNumber forKey:@"phoneNumber"];
    [aCoder encodeObject:_token forKey:@"token"];
    [aCoder encodeInteger:_isInvalid forKey:@"isInvalid"];
    [aCoder encodeObject:_wechatLoginname forKey:@"wechatLoginname"];
    [aCoder encodeObject:_userCategory forKey:@"userCategory"];
    [aCoder encodeObject:_verifyCode forKey:@"verifyCode"];
    [aCoder encodeObject:_nickname forKey:@"nickname"];
    [aCoder encodeObject:_bgcode forKey:@"bgcode"];
    [aCoder encodeObject:_phonemodel forKey:@"phonemodel"];
    [aCoder encodeObject:_operatesystem forKey:@"operatesystem"];
    [aCoder encodeObject:_appversion forKey:@"appversion"];
    [aCoder encodeInteger:_score forKey:@"score"];
    [aCoder encodeObject:_latitude forKey:@"latitude"];
    [aCoder encodeInteger:_sex forKey:@"sex"];
    
    
    [aCoder encodeObject:_signature forKey:@"signature"];
    [aCoder encodeObject:_roleId forKey:@"roleId"];
    [aCoder encodeObject:_identitynumber forKey:@"identitynumber"];
    [aCoder encodeObject:_Systemversion forKey:@"Systemversion"];
    [aCoder encodeObject:_id forKey:@"id"];
    [aCoder encodeObject:_is_login forKey:@"is_login"];
    [aCoder encodeInteger:_auth forKey:@"auth"];
    [aCoder encodeObject:_email forKey:@"email"];
    [aCoder encodeObject:_longitude forKey:@"longitude"];
    [aCoder encodeObject:_token forKey:@"token"];
    [aCoder encodeObject:_headImgUrl forKey:@"headImgUrl"];
    [aCoder encodeObject:_loginName forKey:@"loginName"];
    [aCoder encodeObject:_certificateType forKey:@"certificateType"];
    [aCoder encodeObject:_phoneNumber forKey:@"phoneNumber"];
    [aCoder encodeObject:_regTime forKey:@"regTime"];
}

-(instancetype)initWithCoder:(NSCoder *)aDecoder{
    self = [super init];
    if (self) {
        _name = [aDecoder decodeObjectForKey:@"name"];
        _password = [aDecoder decodeObjectForKey:@"password"];
        _phoneNumber =[aDecoder decodeObjectForKey:@"phoneNumber"];
        _token =[aDecoder decodeObjectForKey:@"token"];
        _isInvalid =[aDecoder decodeIntegerForKey:@"isInvalid"];
        _wechatLoginname =[aDecoder decodeObjectForKey:@"wechatLoginname"];
        _userCategory =[aDecoder decodeObjectForKey:@"userCategory"];
        _verifyCode =[aDecoder decodeObjectForKey:@"verifyCode"];
        _nickname =[aDecoder decodeObjectForKey:@"nickname"];
        _phonemodel =[aDecoder decodeObjectForKey:@"phonemodel"];
        _operatesystem =[aDecoder decodeObjectForKey:@"operatesystem"];
        _appversion =[aDecoder decodeObjectForKey:@"appversion"];
         _score =[aDecoder decodeIntegerForKey:@"score"];
         _latitude =[aDecoder decodeObjectForKey:@"latitude"];
        _sex =[aDecoder decodeIntegerForKey:@"sex"];
        _signature = [aDecoder decodeObjectForKey:@"signature"];
        _roleId = [aDecoder decodeObjectForKey:@"roleId"];
        _identitynumber = [aDecoder decodeObjectForKey:@"identitynumber"];
        _Systemversion = [aDecoder decodeObjectForKey:@"Systemversion"];
        _id = [aDecoder decodeObjectForKey:@"id"];
        _is_login = [aDecoder decodeObjectForKey:@"is_login"];
        _auth = [aDecoder decodeIntegerForKey:@"auth"];
        _email = [aDecoder decodeObjectForKey:@"email"];
        _longitude = [aDecoder decodeObjectForKey:@"longitude"];
        _token = [aDecoder decodeObjectForKey:@"token"];
        _headImgUrl = [aDecoder decodeObjectForKey:@"headImgUrl"];
        _loginName = [aDecoder decodeObjectForKey:@"loginName"];
        _certificateType = [aDecoder decodeObjectForKey:@"certificateType"];
        _phoneNumber = [aDecoder decodeObjectForKey:@"phoneNumber"];
        _regTime = [aDecoder decodeObjectForKey:@"regTime"];
    }
    return self;
}

@end
